package com.niiwoo.civet.account.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum CanRefundEnum {
    CAN_REFUND((byte)1,"可执行还款"),
    REFUNDING((byte)2,"还款正在执行中");

    private Byte code;
    private String desc;

    public static CanRefundEnum getEnumByCode(byte enumCode) {
        if (Objects.nonNull(enumCode)) {
            for (CanRefundEnum retEnum : CanRefundEnum.values()) {
                if (enumCode == retEnum.getCode()) {
                    return retEnum;
                }
            }
        }
        return null;
    }
}
